VxCenterVertically


Set the top offset of the source widget to line up with the centerline of the target widget

Syntax

VxCenterVertically targetWidget sourceWidget

Description

Given two widgets which have been created with the sourceWidget positioned via -alignTop relative to the targetWidget, this sets the top offset of the sourceWidget so that the targetWidget is in the center.

Parameters

targetWidget
The widget you are centering around.

sourceWidget
The widget that will be adjusted.

Example

The following code produces two PushButtons, with the right PushButton aligned with the center of the left PushButton.

set app [VtOpen demo]

set fn [VtFormDialog $app.fn -title "VxCenterVertically Demo" ]

set but1 [VtPushButton $fn.but1 \
	-leftSide FORM \
	-label "Bananas, Apples, Melons\n\nand\n\nGrapefruit"]

set but2 [VtPushButton $fn.but2 \
	-rightSide FORM \
	-leftSide but1 \
	-alignTop but1 \
	-label "Kumquats"]

VxCenterVertically $but1 $but2

VtShow $fn
VtMainLoop

This code produces the following: